# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingMetadata do
  @moduledoc """
  Metadata returned to client when grounding is enabled.

  ## Attributes

  *   `groundingChunks` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingChunk.t)`, *default:* `nil`) - List of supporting references retrieved from specified grounding source.
  *   `groundingSupports` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingSupport.t)`, *default:* `nil`) - Optional. List of grounding support.
  *   `retrievalMetadata` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1RetrievalMetadata.t`, *default:* `nil`) - Optional. Output only. Retrieval metadata.
  *   `searchEntryPoint` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SearchEntryPoint.t`, *default:* `nil`) - Optional. Google search entry for the following-up web searches.
  *   `webSearchQueries` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Web search queries for the following-up web search.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :groundingChunks =>
            list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingChunk.t()) | nil,
          :groundingSupports =>
            list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingSupport.t()) | nil,
          :retrievalMetadata =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1RetrievalMetadata.t() | nil,
          :searchEntryPoint =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SearchEntryPoint.t() | nil,
          :webSearchQueries => list(String.t()) | nil
        }

  field(:groundingChunks,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingChunk,
    type: :list
  )

  field(:groundingSupports,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingSupport,
    type: :list
  )

  field(:retrievalMetadata,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1RetrievalMetadata
  )

  field(:searchEntryPoint,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SearchEntryPoint
  )

  field(:webSearchQueries, type: :list)
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingMetadata do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingMetadata.decode(value, options)
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GroundingMetadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
